#include <iostream>
#include "ThreadPool.hpp"
#include "Thread.hpp"
#include "Task.hpp"
#include <memory>
#include "log.hpp"
using namespace ThreadModule;
int main()
{

    LOG(DEBUG, "程序已经加载");

    thread_pool<Task>::GetInstance();


    thread_pool<Task>::GetInstance();


    thread_pool<Task>::GetInstance();


    thread_pool<Task>::GetInstance();
    thread_pool<Task>::GetInstance()->Wait();


    // Enablefile();
    // std::unique_ptr<thread_pool<Task>> tp = std::make_unique<thread_pool<Task>>(5);
    // tp->Init_thread_pool();
    // tp->Start_threads();
    // int cnt = 10;
    // srand((signed)time(NULL));
    // while(cnt--)
    // {
    //     int frist = rand()%10+1;
    //     usleep(1234);
    //     int second = rand()%10+1;

    //     Task t(frist,second);
    //     LOG(INFO,"main send Task is :%s", t.Debug_tostring().c_str());//打印日志

    //     tp->Enqueue(t);
    //     sleep(2);
    // }
    // tp->Stop();
    // tp->WaitAllThread();
    // LOG(INFO,"main thread is quit ... \n");//打印日志

    return 0;
}